package cas.ihep.alluxio;

import alluxio.AlluxioURI;
import alluxio.util.network.NetworkAddressUtils;
import cas.ihep.alluxio.impl.AlluxioBaseSystem;

import java.io.Closeable;
import java.io.IOException;

public interface AlluxioSystem extends Closeable{

    String localHostName= NetworkAddressUtils.getLocalHostName();

    static AlluxioSystem get(){
        try {
            return new AlluxioBaseSystem();
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    static AlluxioURI newURI(java.net.URI baseUri){
        return AlluxioBaseSystem.newURI(baseUri);
    }

    AlluxioFile open(AlluxioURI path)throws IOException;
    AlluxioFile create(AlluxioURI path)throws IOException;
    void persist(AlluxioURI path)throws IOException;
    boolean hasLocalWorker();
}
